home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / __Packages / Escalator.as < prev    next >
Encoding:
Text File  |  2007-09-28  |  926 b   |  40 lines

  1. class Escalator extends MovieClip
  2. {
  3.    var direction;
  4.    var x;
  5.    var interval_id = 0;
  6.    function Escalator()
  7.    {
  8.       super();
  9.    }
  10.    function init(direction)
  11.    {
  12.       this.direction = direction;
  13.       this.x = this._x;
  14.       if(this.direction < 0)
  15.       {
  16.          this._name = "UpEscalator" + _global.MallCrawl.upEscalators.length;
  17.          _global.MallCrawl.upEscalators.push(this);
  18.          _global.BigKid.available_to_hit = false;
  19.       }
  20.       else
  21.       {
  22.          this._name = "DownEscalator" + _global.MallCrawl.downEscalators.length;
  23.          _global.MallCrawl.downEscalators.push(this);
  24.          _global.BigKid.available_to_hit = false;
  25.       }
  26.    }
  27.    function activate(mc)
  28.    {
  29.       if(this.direction < 0)
  30.       {
  31.          mc.glevel += 1;
  32.       }
  33.       else
  34.       {
  35.          mc.glevel -= 1;
  36.       }
  37.       mc.interval_id = setInterval(mc,"escalate",10,this);
  38.    }
  39. }
  40.